cmake_minimum_required (VERSION 3.5)

project(core)

file(GLOB_RECURSE SRC_DIR "./*.cpp")
message(${SRC_DIR})

#NOTE: You don't need to add the path if your header and lib in the compiler default search path
#Add path to search include fies
#include_directories("your-include-path")
#Add path to search libraries
#link_directories("your-include-path")

add_library(${PROJECT_NAME} SHARED ${SRC_DIR})

target_link_libraries(${PROJECT_NAME} PRIVATE spdlog fmt $<$<BOOL:${MINGW}>:ws2_32>)

#target_link_libraries(${PROJECT_NAME} PRIVATE 
#        your-lib-here #note: libxxx.so -> xxx should be put here
#        )

#Search link modules by pkg-config tool
# find_package(PkgConfig REQUIRED)
# pkg_check_modules (SPDLOG REQUIRED IMPORTED_TARGET spdlog)

# target_link_libraries(${PROJECT_NAME} PRIVATE 
#         PkgConfig::SPDLOG
#         )

install(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_DIR})